<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Feed Aggregator</title>
</head>
<body>

<?php

    define('MAGPIE_OUTPUT_ENCODING', 'UTF-8');
    $num_items = 10;
	require_once('rss_fetch.inc');
	$url = isset($_GET['url']) ? $_GET['url'] : "http://www.cndkc.net/bbs/rss.php?auth=0";
	$rss = fetch_rss( $url );
	
	echo "Channel Title: " . $rss->channel['title'] . "<p>";
    $items = array_slice($rss->items, 0, $num_items);
	foreach ($items as $item) {
		$href = $item['link'];
		$title = $item['title'];
        $description = $item['description'];
		echo "<p><h2><a href=$href>$title</a></h2><p>$description</p></p>";
	}


?>

</body>
</html>
